package lib.map.objects;

import java.awt.Color;
import java.awt.Image;

import lib.Utils;
import lib.player.items.Item;

public class MapElement {
	Utils util=new Utils();
	public int NR=0;
	public String Name="";
	public Image[] Textures = new Image[1];
	public boolean Block = false;
	public boolean pickable = false;
	public boolean kill=false;
	public Color color=new Color(0,0,0,0);
	public int hitpoints = 100;

	public MapElement( String[] Sources, boolean Block) {
		this.Block = Block;
		Textures = util.imageLodaer(Sources);
	}

	public MapElement(boolean Block) {
		this.Block = Block;
	}
	public MapElement() {
		// TODO Auto-generated constructor stub
	}

	public MapElement( String[] Sources, boolean Block,
			boolean pickable) {
		this.pickable = pickable;
		this.Block = Block;
		Textures = util.imageLodaer(Sources);
	}

	//for items
	public MapElement( Item i) {		
		this.Name=i.Name;
		this.NR=i.NR;
		Textures = i.Textures;
		pickable=true;
		color=i.color;
	}

	/**
	 * 
	 * @param val
	 *            Phase for animation
	 * @return Image
	 */

	public Image getTexture(int val) {
		return Textures[val % Textures.length];
	}

	public MapElement clone() {
		MapElement e=new MapElement();
		e.NR=NR;
		e.Name=Name;
		e.Textures = Textures;
		e.Block = Block;
		e.pickable = pickable;
		e.kill=kill;
		e.color=color;
		e.hitpoints =hitpoints;
		
		return e;
	}

}
